import cv2

img1 = cv2.imread('bg.jpg')
img2 = cv2.imread('fish.jpg')

print('img1 is shape:', img1.shape)
print('img2 is shape:', img2.shape)

print('-' * 60)

# (h, w, c)
print('img1 partial data:', img1[:5, :, 0])
print('img2 partial data:', img2[:5, :, 0])

print('-' * 60)

img1_ = img1 + 10
print('img1 + 10 partial data:', img1_[:5, :, 0])

print('-' * 60)

# 在cv2 里面 超过255 会执行取余操作 让数据映射到0~255之内
print('img1 + img1_ partial data:', (img1 + img1_)[:5, :, 0])

print('-' * 60)

# cv2.add 超过0~255 会让所有超过 255 的数值归一化为 255
print(cv2.add(img1, img1_)[:5, :, 0])
